<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <script src="../js/cookie.js"></script>
    <style>
        .header{
            width: 1226px;
            margin: 0 auto;
            background-color: #e3e4e5;
            height: 45px;
            line-height: 45px;
            font-size: 12px;
        }
        .nav li{
            float: left;
            padding: 0 10px;
        }
        .hide{
            display: none;
        }
    </style>
</head>
<body>
    <div class="header">
        <ul class="nav fl clear">
            <li>中国大陆</li>
            <li class="sign-login">
                <a href="./login.html">你好,请登录</a>
                <a href="./register.html">免费注册</a>
            </li>
            <li class="sign-user hide">
                <a class="wel" href="javascript:;">欢迎xxx</a>
                <a class="exit" href="javascript:;">退出</a>
            </li>
            <li>我的订单</li>
        </ul>
    </div>
</body>
<script>
    var signLogin =document.getElementsByClassName("sign-login")[0]; 
    var signUser =document.getElementsByClassName("sign-user")[0]; 
    var wel =document.getElementsByClassName("wel")[0]; 
    var exit =document.getElementsByClassName("exit")[0]; 

    // 标识用户身份
    var lgc = getCookie("lgc");
    if(lgc){
        signUser.classList.remove("hide");
        signLogin.classList.add("hide");

        wel.textContent = "欢迎," + lgc;

        exit.onclick = function(){
            setCookie("lgc","", -1);
            location.reload();
        }
    }




</script>
</html>